package com.airline.connection;

public class AirlineSystemServiceProxy implements com.airline.connection.AirlineSystemService {
  private String _endpoint = null;
  private com.airline.connection.AirlineSystemService airlineSystemService = null;
  
  public AirlineSystemServiceProxy() {
    _initAirlineSystemServiceProxy();
  }
  
  public AirlineSystemServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initAirlineSystemServiceProxy();
  }
  
  private void _initAirlineSystemServiceProxy() {
    try {
      airlineSystemService = (new com.airline.connection.AirlineSystemServiceServiceLocator()).getAirlineSystemService();
      if (airlineSystemService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)airlineSystemService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)airlineSystemService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (airlineSystemService != null)
      ((javax.xml.rpc.Stub)airlineSystemService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.airline.connection.AirlineSystemService getAirlineSystemService() {
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService;
  }
  
  public boolean logout(java.lang.String personID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.logout(personID);
  }
  
  public com.airline.beans.Employee employeeLogin(java.lang.String employeeID, java.lang.String password) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.employeeLogin(employeeID, password);
  }
  
  public com.airline.beans.Employee getEmployee(java.lang.String employeeID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getEmployee(employeeID);
  }
  
  public com.airline.beans.Customer customerLogin(java.lang.String customerID, java.lang.String password) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.customerLogin(customerID, password);
  }
  
  public com.airline.beans.Customer getCustomer(java.lang.String customerID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getCustomer(customerID);
  }
  
  public java.lang.String createEmployee(com.airline.beans.Employee e) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.createEmployee(e);
  }
  
  public com.airline.beans.Employee[] searchEmployees(com.airline.beans.Employee e, java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.searchEmployees(e, startingPoint, numOfRecords);
  }
  
  public boolean deleteEmployee(java.lang.String employeeID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.deleteEmployee(employeeID);
  }
  
  public boolean updateEmployee(com.airline.beans.Employee e) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.updateEmployee(e);
  }
  
  public java.lang.String createCustomer(com.airline.beans.Customer c) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.createCustomer(c);
  }
  
  public com.airline.beans.Customer[] searchCustomers(com.airline.beans.Customer c, java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.searchCustomers(c, startingPoint, numOfRecords);
  }
  
  public boolean deleteCustomer(java.lang.String customerID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.deleteCustomer(customerID);
  }
  
  public boolean updateCustomer(com.airline.beans.Customer c) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.updateCustomer(c);
  }
  
  public java.lang.String createJourney(com.airline.beans.Journey journey) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.createJourney(journey);
  }
  
  public com.airline.beans.Journey[] searchJourneys(com.airline.beans.Journey journey) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.searchJourneys(journey);
  }
  
  public com.airline.beans.Flight getFlight(java.lang.String flightID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getFlight(flightID);
  }
  
  public boolean updateFlight(com.airline.beans.Flight flight) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.updateFlight(flight);
  }
  
  public boolean cancelJourney(java.lang.String journeyID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.cancelJourney(journeyID);
  }
  
  public com.airline.beans.Journey getJourney(java.lang.String journeyID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getJourney(journeyID);
  }
  
  public java.lang.String createFlight(com.airline.beans.Flight flight) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.createFlight(flight);
  }
  
  public com.airline.beans.Flight[] searchFlights(com.airline.beans.Flight flight, java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.searchFlights(flight, startingPoint, numOfRecords);
  }
  
  public boolean deleteFlight(java.lang.String flightID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.deleteFlight(flightID);
  }
  
  public com.airline.beans.Employee[] getAllEmployees(java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllEmployees(startingPoint, numOfRecords);
  }
  
  public com.airline.beans.Customer[] getAllCustomers(java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllCustomers(startingPoint, numOfRecords);
  }
  
  public com.airline.beans.Flight[] getAllFlights(java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllFlights(startingPoint, numOfRecords);
  }
  
  public com.airline.beans.Journey[] getAllJourneys() throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllJourneys();
  }
  
  public com.airline.beans.Journey[] searchFlightItineraries(com.airline.beans.Flight flight, java.lang.String startingPoint, java.lang.String numOfRecords) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.searchFlightItineraries(flight, startingPoint, numOfRecords);
  }
  
  public com.airline.beans.Customer[] getAllCustomersByFlightID(java.lang.String flightID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllCustomersByFlightID(flightID);
  }
  
  public com.airline.beans.Flight[] getAllFlightsByJourneyID(java.lang.String journeyID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllFlightsByJourneyID(journeyID);
  }
  
  public com.airline.beans.Journey[] getAllJourneysByCustomerID(java.lang.String customerID) throws java.rmi.RemoteException{
    if (airlineSystemService == null)
      _initAirlineSystemServiceProxy();
    return airlineSystemService.getAllJourneysByCustomerID(customerID);
  }
  
  
}